package com.zenithmind.coding.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 代码运行DTO
 * 
 * @author ZenithMind Team
 * @since 2025-01-09
 */
@Data
@Schema(description = "代码运行DTO")
public class CodeRunDTO {

    /**
     * 编程语言
     */
    @NotBlank(message = "编程语言不能为空")
    @Schema(description = "编程语言", example = "java")
    private String language;

    /**
     * 源代码
     */
    @NotBlank(message = "源代码不能为空")
    @Size(min = 1, max = 65535, message = "源代码长度必须在1-65535之间")
    @Schema(description = "源代码", example = "public class Main {\n    public static void main(String[] args) {\n        System.out.println(\"Hello World!\");\n    }\n}")
    private String sourceCode;

    /**
     * 输入数据
     */
    @Schema(description = "输入数据", example = "5\n1 2 3 4 5")
    private String input;

    /**
     * 时间限制（毫秒）
     */
    @Schema(description = "时间限制（毫秒）", example = "1000")
    private Integer timeLimit = 1000;

    /**
     * 内存限制（KB）
     */
    @Schema(description = "内存限制（KB）", example = "65536")
    private Integer memoryLimit = 65536;

    /**
     * 是否调试模式（0-否，1-是）
     */
    @Schema(description = "是否调试模式（0-否，1-是）", example = "0")
    private Integer debugMode = 0;

    /**
     * 编译参数
     */
    @Schema(description = "编译参数", example = "-O2")
    private String compileArgs;

    /**
     * 运行参数
     */
    @Schema(description = "运行参数")
    private String runArgs;
}
